<template>
  <FormItem :label="label" :prop="prop" :icon="icon" :single="single">
    <Input :type="type" :model-value="modelValue" @input="updateValue($event.target.value)" :readonly="see || readonly" />
  </FormItem>
</template>
<script>
export default {
  name: "FormInput",
  props: {
    label: "",
    prop: "",
    type: {
      default: "text"
    },
    modelValue: String,
    single: {
      default: false
    },
    icon: {
      default: ""
    },
    readonly: {
      default: false
    }
  },
  computed: {
    see() {
      return this.$store.forms.see;
    }
  },
  methods: {
    updateValue(newValue) {
      this.$emit("update:modelValue", newValue);
    }
  }
};
</script>